package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AddConfig struct {
	Mysql struct {
		Host     string
		Port     int
		User     string
		Password string
		Database string
	}
	Redis struct {
		Host     string
		Port     int
		Password string
		Database int
	}
	SendSms struct {
		Account  string
		Password string
	}
	QiNiuYun struct {
		AccessKey string
		SecretKey string
		Bucket    string
		Url       string
	}
}

var Config AddConfig

func Init() {
	viper.SetConfigFile("../appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Config)
	fmt.Println("配置动态文件加载", Config)
}
